package edu.zut.hb.software.waypath.impl;

import java.util.ArrayList;
import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import edu.zut.hb.software.base.service.impl.GenericManagerImpl;
import edu.zut.hb.software.waypath.LineService;
import edu.zut.hb.software.waypath.dao.LineDao;
import edu.zut.hb.software.waypath.domain.Line;

@Service
@Transactional
public class LineServiceImpl extends GenericManagerImpl<Line,Long> implements LineService {

    LineDao lineDao;

    @Autowired
    public void setLineDao(LineDao lineDao) {
        this.lineDao = lineDao;
        this.dao=this.lineDao;
    }

    @Override
    public List list() {
        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            Line line = new Line();
            line.setName("第"+i+"条路线");
            line.setNum(i);
            line.setStatus(true);
            list.add(line);
        }
        return list;
    }
}
